//
//  DateReserveCell.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2020/2/26.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

class DateReserveCell: UICollectionViewCell {
    
    @IBOutlet private weak var dateLabel: UILabel! {
        didSet {
            dateLabel.backgroundColor = .white
            dateLabel.layer.cornerRadius = 8
            dateLabel.layer.masksToBounds = true
//            dateLabel.layer.borderColor = UIColor.splLineNormal.cgColor
//            dateLabel.layer.borderWidth = 1
        }
    }
    
    func configure(with model: DateWeekModel, indexPath: IndexPath) {
        switch indexPath.item {
        case 0:
            dateLabel.text = "任意时间"
        default:
            dateLabel.text = "\(model.monthDay)\n\(model.weekDay) \(model.timeIntervalStr)"
        }
    }
    
    func setSelected(reset: Bool) {
        if reset {
           // dateLabel.layer.borderColor = UIColor.splLineNormal.cgColor
            dateLabel.textColor = .textLight
            dateLabel.backgroundColor = .clear
        } else {
           // dateLabel.layer.borderColor = UIColor.splLineSelect.cgColor
            dateLabel.textColor = .white
            dateLabel.backgroundColor = UIColor(hex: "#5481FA")
        }
    }
}
